package org.edith.shiro.service.impl;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.edith.shiro.dao.SysMenuDAO;
import org.edith.shiro.dataobject.SysMenuDO;
import org.edith.shiro.service.SysMenuService;

import javax.annotation.PostConstruct;
import java.util.List;

/**
 *  权限业务实现
 */
@Service("edithSysMenuService")
public class SysMenuServiceImpl  implements SysMenuService {
    @Autowired
    private SysMenuDAO sysMenuDAO;
    @PostConstruct
    private void createTable(){
        sysMenuDAO.createTable();
    }
    /**
     * 根据角色ID查询用户权限
     *
     * @param roleId 角色ID
     * @return List<SysMenuDO> 权限集合
     */
    @Override
    public List<SysMenuDO> selectSysMenuByRoleId(Long roleId) {
        return this.sysMenuDAO.selectSysMenuByRoleId(roleId);
    }
}